﻿using App.Interface;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace App.Realization
{
    public class Class1 : IClass1
    {
        public void BoHuiYiJianYiYue(int mkhbid)
        {
            var result = HttpClientHelper.GetResponse(System.Web.Configuration.WebConfigurationManager.AppSettings["schoolapi"] + "/api/KaoHeBiaoCaoZuo/BoHuiYiJianYiYue?mkhbid=" + mkhbid);
        }

        public string GetMyBoHuiYiJian(string username)
        {
            var result = HttpClientHelper.GetResponse(System.Web.Configuration.WebConfigurationManager.AppSettings["schoolapi"] + "/api/KaoHeBiaoCaoZuo/GetMyBoHuiYiJian?username=" + username);
            return result;
        }

        public string test1()
        {

            dynamic aa = new { username = "工工夺顶替使用者要顶替地要地在地在地response.Content.ReadAsStringAsync()", password = "MessageBox.Show(responseString)" };
            string aaa = JsonConvert.SerializeObject(aa);
            var result = HttpClientHelper.PostResponse("http://schoolapi.osmars.site/api/Login/Test?str=" + Uri.EscapeUriString(aaa), "str=" + aaa);
            // HttpHelper.HttpPost("http://schoolapi.osmars.site/api/Login/Test", aaa);
            return result;
        }

        public string test2()
        {
            dynamic aa = new { username = "工工夺顶替使用者要顶替地要地在地在地response.Content.ReadAsStringAsync()", password = "MessageBox.Show(responseString)" };
            var a = new Dictionary<string, string>();
          
            string aaa = JsonConvert.SerializeObject(aa);
            var reslut = HttpClientHelper.PostResponse("http://schoolapi.osmars.site/api/Login/Test", aaa);
            #region 传一个参数
            //a.Add("", "123");
            //var reslut = HttpClientHelper.PostResponse("http://localhost:53119/api/Login/Test", "123"); 
            #endregion
            //            string heads= @"Accept:text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
            //Accept-Encoding:gzip, deflate
            //Accept-Language:zh-CN,zh;q=0.8
            //Cache-Control:no-cache
            //Content-Length:251
            //Content-Type:application/x-www-form-urlencoded; charset=UTF-8
            //Cookie:JSESSIONID=B1716F5DAC2F78D1E592F5421D859CFA; Hm_lvt_f44f38cf69626ed8bcfe92d72ed55922=1498099203; Hm_lpvt_f44f38cf69626ed8bcfe92d72ed55922=1498099203; cache_cars=152%7C152%7CBDL212%7C111111%7C111111%2C152%7C152%7CBy769x%7C111111%7C111111%2C152%7C152%7Cd12881%7C111111%7C111111
            //Host:www.xxxxxxxx.com
            //Origin:http://www.xxxxxxxx.com
            //Pragma:no-cache
            //Proxy-Connection:keep-alive
            //Referer:http://www.cheshouye.com/api/weizhang/
            //User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
            //X-Requested-With:XMLHttpRequest";

            //var reslut = new HttpRequestClient().httpPost("http://schoolapi.osmars.site/api/Login/Test", heads, "str=123", Encoding.UTF8);
            return reslut;
        }
    }
}
